﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace Luminal
{
    struct SizeT
    {
        IntPtr value;

        public SizeT(IntPtr value)
        {
            this.value = value;
        }

        public SizeT(int value)
        {
            this.value = new IntPtr(value);
        }

        public SizeT(long value)
        {
            this.value = new IntPtr(value);
        }

        public static implicit operator IntPtr(SizeT value)
        {
            return value.value;
        }

        public static implicit operator SizeT(IntPtr value)
        {
            return new SizeT(value);
        }

        public static implicit operator int(SizeT value)
        {
            return value.value.ToInt32();
        }

        public static implicit operator SizeT(int value)
        {
            return new SizeT(value);
        }

        public static implicit operator long(SizeT value)
        {
            return value.value.ToInt64();
        }

        public static implicit operator SizeT(long value)
        {
            return new SizeT(value);
        }

        public override string ToString()
        {
            return value.ToString();
        }

        public override int GetHashCode()
        {
            return value.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            return value.Equals(obj);
        }
    }
}
